package com.guhus.ec.service.seller.impl;

import com.guhus.ec.pojo.seller.Product;
import com.guhus.ec.mapper.seller.ProductMapper;
import com.guhus.ec.service.seller.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    ProductMapper productMapper;

    @Override
    public List<Product> selectAllProducts() {
        return productMapper.selectAllProducts();
    }

    @Override
    public Product selectProductById(Integer id) {
        return productMapper.selectProductById(id);
    }

    @Override
    public Product selectProductByName(String name) {
        return productMapper.selectProductByName(name);
    }

    @Override
    public void insertProduct(Product product) {
        productMapper.insertProduct(product);
    }

    @Override
    public void deleteProductById(Integer id) {
        productMapper.deleteProductById(id);
    }

    @Override
    public void updateProduct(Product product) {
        productMapper.updateProduct(product);
    }


}
